package com.bingo.shardingspheredemo;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.bingo.shardingspheredemo.dao.UserMapper;
import com.bingo.shardingspheredemo.model.User;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 类描述：
 *
 * @ClassName TestController
 * @Description TODO
 * @Author wadexi
 * @Date 2025/2/11
 */
@Controller
@RequestMapping("/shardingjdbc")
public class TestController {

    @Resource
    private UserMapper userMapper;

    @GetMapping("/test1")
    @ResponseBody
    public List<User> testSharingspherjdbc(){

        List<User> users = userMapper.selectList(Wrappers.emptyWrapper());

        return users;
    }
}
